#include <iostream> 
using namespace std;

int main()
{
	int month = 1, save = 0, budget = 0, jin = 0;
	for (int i = 1; i <= 12; i++)
	{
		cin >> budget;
		jin += 300 - budget;

		if (jin < 0)
		{
			month = i;
			cout << "-" << month << endl;
			break;
		}
		else
		{
			save += jin / 100 * 100;
			jin = jin % 100;
		}
		if(i == 12)
			cout << save * 1.2 + jin << endl;
	}
	
	return 0;
}
